/*
argument0: indicate how many enemy should be gen in the same time
argument1: indicate the enemy type
*/

var rep_seed;
var obj_enemy;

rep_seed = argument0;
e_type = argument1;
top_bound = ds_map_find_value(enemy_top_bound,e_type);
bottom_bound = ds_map_find_value(enemy_bottom_bound,e_type);

rep = round(random(rep_seed));
repeat(rep){
    seed = round(random(1));
    if (seed==0){
        enemy = instance_create(0,random_range(top_bound,bottom_bound),ds_map_find_value(enemy_right,e_type));
        enemy.hspeed = enemy_base_speed * ds_map_find_value(enemy_speed_weight,e_type);
    }else{
        enemy = instance_create(room_width,random_range(top_bound,bottom_bound),ds_map_find_value(enemy_left,e_type));
        enemy.hspeed = -enemy_base_speed * ds_map_find_value(enemy_speed_weight,e_type);
    }
    enemy.e_type = e_type;
    enemy.image_speed = ds_map_find_value(enemy_image_speed,e_type);
    enemy.e_health = enemy_base_health * ds_map_find_value(enemy_health_weight,e_type);
    enemy.e_score = enemy_base_score * ds_map_find_value(enemy_score_weight,e_type);
    enemy.e_growth = enemy_base_growth * ds_map_find_value(enemy_growth_weight,e_type);
    
}
